/* ---------------------------------------------------------------------------------------------------------------------
 * File: teamlineupscreen.cpp
 * Author: Daniel Pop, Felix Rodriguez
 * Purpose: The scope for this class is to give the user the option to choose the possition of the players
 * ---------------------------------------------------------------------------------------------------------------------*/

#ifndef TEAMLINEUPSCREEN_H
#define TEAMLINEUPSCREEN_H
#include "base.h"
#include "scorekeeperscreen.h"
#include <QMainWindow>
#include <QGraphicsScene>
#include "playericon.h"
#include "scorekeeperscreen.h"

namespace Ui {
class teamLineUpScreen;
}

class teamLineUpScreen : public QMainWindow
{
    Q_OBJECT

public:
    explicit teamLineUpScreen(QWidget *parent = 0);
    teamLineUpScreen(QVector<Player*> home, QVector<Player*> away);
    ~teamLineUpScreen();
    QList<PlayerIcon*> playersOnField;
    Player* getHomePitcher();
    Player* getAwayPitcher();

private:
    Ui::teamLineUpScreen *ui;
    QGraphicsScene* theScene2;
    void updateValues();
    void clearBases();
    void spawnPlayer();
    void manageBases();
    void updateKeeperBases(Player* p);
    void showHomePlayers();
    void showAwayPlayers();
    int getPlayerLineupPosition(Player* p);
    Player* homePitcher;
    Player* awayPitcher;
    bool isHome;
    Base* catcher;
    Base* pitcher;
    Base* first_Base;
    Base* second_Base;
    Base* third_Base;
    Base* short_Stop;
    Base* center_Field;
    Base* left_Field;
    Base* right_Field;
    QVector<Player*> homePlayers;
    QVector<Player*> awayPlayers;
    QVector<PlayerIcon*> *icons;
    public slots:
    void save();

};

#endif // TEAMLINEUPSCREEN_H
